-
Notifications
You must be signed in to change notification settings - Fork 13.6k
fix: Reject async assoc fns of const traits/impls in ast_passes #144907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
This comment has been minimized.
This comment has been minimized.
00e73ac
to
88fa481
Compare
This PR changes a file inside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor nits
Oh sry, didn't see errs assigned themself. I will wait for them. |
Thanks for the review anyway. I'll fix the nits! |
88fa481
to
c700d01
Compare
@bors r=fmease |
#[const_trait]
in ast_passeslet TraitOrTraitImpl::Trait { constness: Const::Yes(const_trait), .. } = parent else { | ||
return; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also gonna want to reject async
fns inside const
trait impls. The following code exhibits the same ICE atm:
#![feature(const_trait_impl)]
const trait Trait { fn f() -> impl Future<Output = ()>; }
impl const Trait for () { async fn f() {} }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch. I couldn't think of such cases 😅 Thanks!
My bad, I forgot one thing. r? fmease @bors r- |
c700d01
to
333fd0b
Compare
333fd0b
to
804db3c
Compare
Fixes #117629